package com.ytjj.qmyx.supplychain.service;


import com.ytjj.qmyx.supplychain.common.kafka.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Service;


@Service
@EnableBinding({IAppActivationKafkaOut.class})
@ConditionalOnProperty(prefix = "config.project", name = "enable", havingValue = "true")
public class KafkaSendService {



    @Autowired
    private IAppActivationKafkaOut appActivationKafkaOut;

    
    public boolean middleEndTrade(String msg) {
        return appActivationKafkaOut.middleEndTrade().send(MessageBuilder.withPayload(msg).build());
    }

    public boolean middleEndTradeTest(String msg) {
        return appActivationKafkaOut.middleEndTradeTest().send(MessageBuilder.withPayload(msg).build());
    }
}
